package com.zl.learning.thread.thread_daemon;

import java.util.Scanner;

/**
 * Created by zhaolei on 2017/4/17.
 *
 */
public class DaemonThreadDemo {
    public static void main(String[] args) {
        System.out.println("进入主线程"+Thread.currentThread().getName());
        DaemonThread daemonThread = new DaemonThread();
        Thread thread = new Thread(daemonThread);
        thread.setDaemon(true);
        thread.start();
        Scanner in = new Scanner(System.in);
        in.next();
        System.out.println("退出主线程"+Thread.currentThread().getName());
    }
}
